<?php
/**
 * This file is part of the Agora distribution. 
 * Detailed copyright and licensing information can be found
 * in the gpl-3.0.txt file which should be included in the distribution.
 * 
 * @version		$Id: 3.0.14 Olympus 2010-09-28 rammstein4o $
 * @copyright  2007 - 2010 jVitals
 * @license   GPLv3 Open Source
 * @link       http://jvitals.com
 * @since      File available since initial release
 */	
@define ('AGORA_VERSION', '3.0.150');

class AgoraDatabaseUpgrade
{
	var $statements = array(
		1 => array(
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_database_revision\', \'1\')',
		),
		array(
			'DROP TABLE IF EXISTS `#__agora_annonces`',
			'ALTER TABLE `#__agora_forums` DROP COLUMN `guest_access`',
			'ALTER TABLE `#__agora_permissions` ADD `use_captcha`	BOOL NOT NULL DEFAULT 0',
			'ALTER TABLE `#__agora_permissions` ALTER COLUMN `use_captcha`	SET DEFAULT 0',
			'ALTER TABLE `#__agora_permissions` ADD `edit_topic`	BOOL NOT NULL DEFAULT 1',
			'ALTER TABLE `#__agora_permissions` ADD `edit_posts`	BOOL NOT NULL DEFAULT 1',
			'ALTER TABLE `#__agora_permissions` ADD `make_sticky`	BOOL NOT NULL DEFAULT 1',
			'ALTER TABLE `#__agora_permissions` ADD `close_topic`	BOOL NOT NULL DEFAULT 1',		
		),
		array(
			'ALTER TABLE `#__agora_subscriptions` ADD `forum_id` INT( 10 ) UNSIGNED NOT NULL DEFAULT \'0\' ADD `category_id` INT( 10 ) UNSIGNED NOT NULL DEFAULT \'0\'',
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_avatars_dheight\', \'100\')',
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_avatars_dwidth\', \'100\')',
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_avatars_ratio\', \'1\')',
		),
		array(
			'ALTER TABLE `#__agora_subscriptions` ADD `forum_id` INT( 10 ) UNSIGNED NOT NULL DEFAULT \'0\'',
			'ALTER TABLE `#__agora_subscriptions` ADD `category_id` INT( 10 ) UNSIGNED NOT NULL DEFAULT \'0\'',
			'ALTER TABLE `#__agora_subscriptions` DROP PRIMARY KEY',
			'ALTER TABLE `#__agora_subscriptions` ADD PRIMARY KEY ( `user_id` , `topic_id` , `forum_id` , `category_id` )',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'10\' WHERE conf_name=\'o_timeout_visit\' AND conf_value=\'600\'',
		),
		array(
			'ALTER TABLE `#__agora_group` DROP COLUMN `access_id`',
			'CREATE TABLE `#__agora_group_permissions`
			(
				`id` int(10) unsigned NOT NULL auto_increment,
				`group_id` int(10) unsigned NOT NULL,
				`role_id` int(10) unsigned NOT NULL,
				`access_id` int(10) unsigned NOT NULL,
				PRIMARY KEY(`id`),
				UNIQUE(`group_id`,`role_id`),
				UNIQUE(`access_id`)
			) Type=MyISAM',
			'setDefaultPermissions',
		),

		array(
			'UPDATE `#__agora_config` SET conf_value=\'txt,jpg,jpeg,png,gif,doc,mp3,pdf,zip,rar\' WHERE conf_name = \'o_uploadile_laws\'',
		),
		// Version bump - it's RC2 now
		array(
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_auto_subscriptions\', \'1\')',
			'ALTER TABLE `#__agora_users` ADD `auto_subscriptions` tinyint(1) NULL  DEFAULT \'1\'',
		),
		array(
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_default_view\', \'forum\')',
		),
		array(
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_bbcode_quickpost\', \'0\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_quickjump_footer\', \'1\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_prof_title\', \'1\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_prof_location\', \'1\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_prof_website\', \'1\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_prof_gender\', \'1\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_prof_dob\', \'1\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_prof_interests\', \'1\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_prof_about\', \'1\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_prof_sig\', \'1\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_prof_messaging\', \'1\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_prof_gallery\', \'1\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_prof_attach\', \'1\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_allow_attach\', \'1\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_main_menu\', \'1\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_bstats\', \'1\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_user_guest\', \'1\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_binfo\', \'1\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_pm_subject\', \'PM Subject\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_pm_messg\', \'<p>Hello [username]<br />You have received a Private message from [sitename] at [site] from [poster]<br />The PM Reads as follows;</p>
<p>[title]</p>
<p>[message]</p>
<p>please login at [site] and view your message</p>
<p>Thank You<br />Site Administration</p>\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_subscr_subject\', \'Subscription Subject\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_subscr_messg\', \'<p>Hello [username]<br /> <br />[poster] replied to to your post on [sitename] to ([title]) which you are subscribed to. <br />[poster] Wrote: <br />[message]<br /> <br />Please click [topic] to view the post <br />Or <br />Please click here to [unsubscribe]<br /> <br /> [site]</p>
<p>Thank You<br />Site Administration</p>\')',
		),
		array (
			'ALTER TABLE `#__agora_ranks` ADD `image` varchar(50) DEFAULT \'\'',
		),
				// Version bump - it's RC1 now
		array(
			'UPDATE `#__agora_config` SET conf_value = \'Agora 3.0.02\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'Agora 3.0.03\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'ALTER TABLE `#__agora_users` ADD INDEX `#__id_index` (`jos_id`)',
		),
		array(
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_guest_userlist\', \'1\')',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'Agora 3.0.04\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'Agora 3.0.05\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'Agora 3.0.06\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_rss_enabled\', \'1\')',
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_legend_enabled\', \'1\')',
		),
		array(
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_bbcode_video_width\', \'425\')',
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_bbcode_video_height\', \'350\')',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'Agora 3.0.06\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'ALTER TABLE `#__agora_warning` ADD `message_txt` text DEFAULT \'\'',
			'ALTER TABLE `#__agora_feeds` ADD  `author` varchar(255) DEFAULT \'Guest\'' ,
			'ALTER TABLE `#__agora_ranks` ADD  `user_type` varchar(50) DEFAULT \'\'' ,
		),
			array(
			'UPDATE `#__agora_config` SET conf_value = \'3.0.07\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'3.0.08\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'3.0.09\' WHERE conf_name=\'o_cur_version\'',
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_include_jquery\', \'1\')',
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_userdata\', \'0\')',
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_fullnames_enabled\', \'0\')',
		),
		array(
			'ALTER TABLE `#__agora_forums` ADD `single_topic` TINYINT( 1 ) NOT NULL DEFAULT \'0\'',
			'ALTER TABLE `#__agora_forums` ADD `enable_sched` TINYINT( 1 ) NOT NULL DEFAULT \'0\'',
			'ALTER TABLE `#__agora_forums` ADD `sched_end` DATETIME NULL',
			'ALTER TABLE `#__agora_forums` ADD `closed` TINYINT( 1 ) NOT NULL DEFAULT \'0\'',
			'ALTER TABLE `#__agora_forums` ADD `closed_text` VARCHAR( 255 ) NULL' ,
		),
		array(
			'ALTER TABLE `#__agora_forums` ADD COLUMN icon_style_id int(10) unsigned NULL DEFAULT 0',
            'ALTER TABLE `#__agora_categories` ADD COLUMN icon_style_id int(10) unsigned NULL DEFAULT 0',
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_joomsocialsuite\', \'0\')',
			'UPDATE `#__agora_config` SET conf_value = \'3.0.10\' WHERE conf_name=\'o_cur_version\'',
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_joomsocialsuite\', \'0\')',
		),
		array(
			'ALTER TABLE `#__agora_subscriptions` ADD `emailed` tinyint(1) UNSIGNED NOT NULL DEFAULT \'0\'',
		    'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_subscrb_emails_type\', \'0\')',
		    'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_subscrb_auto_alladmins\', \'0\')',
		    'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_subscrb_auto_moderators\', \'0\')',
			'UPDATE `#__agora_config` SET conf_value = \'3.0.11\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'',
		),
		
		array('ALTER TABLE `#__agora_users` DROP INDEX `jos_id_index`' ,
              'ALTER TABLE `#__agora_users` ADD UNIQUE `jos_id_index` ( `jos_id` ) ',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'3.0.12\' WHERE conf_name=\'o_cur_version\'',
		),
		array('ALTER TABLE `#__agora_users` DROP UNIQUE `jos_id_index`' ,
              'ALTER TABLE `#__agora_users` ADD INDEX `jos_id_index` ( `jos_id` ) ',
		),
		// we have to use #__ for index names!!!
		array('ALTER TABLE `#__agora_users` DROP INDEX `jos_id_index`' ,
              'ALTER TABLE `#__agora_users` ADD INDEX `#__id_index` ( `jos_id` ) ',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'3.0.13\' WHERE conf_name=\'o_cur_version\'',
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_include_jquery\', \'1\')',
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_userdata\', \'0\')',
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_fullnames_enabled\', \'0\')',
		),
		array(
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_uploadile_disp_size\', \'480\')',
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_allow_delete_attach\', \'1\')',
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_attach_type\', \'1\')',
			'UPDATE `#__agora_config` SET conf_value = \'1229\' WHERE conf_name=\'o_uploadile_maxsize_modo\'',
			'UPDATE `#__agora_config` SET conf_value = \'1229\' WHERE conf_name=\'o_uploadile_maxsize_member\'',
			'UPDATE `#__agora_config` SET conf_value = \'122900\' WHERE conf_name=\'o_uploadile_limit_modo\'',
			'UPDATE `#__agora_config` SET conf_value = \'122900\' WHERE conf_name=\'o_uploadile_limit_member\'',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'3.0.135\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'3.0.136\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'3.0.137\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'3.0.138\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'ALTER TABLE `#__agora_forums` ADD INDEX `#__agora_forums_lastpostid_index` (`last_post_id`)',
			'ALTER TABLE `#__agora_topics` ADD INDEX `#__agora_topics_lastpostid_index` (`last_post_id`)',
		),
		array(
			'ALTER TABLE `#__agora_users` ADD  `last_known_ip` varchar(15) DEFAULT \'0.0.0.0\'' ,
			'UPDATE `#__agora_config` SET conf_value = \'3.0.14\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'ALTER TABLE `#__agora_users` ADD INDEX `#__agora_users_num_posts_idx` (`num_posts`)',
			'ALTER TABLE `#__agora_posts` ADD INDEX `#__agora_posts_posted_idx` (`posted`)',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'3.0.141\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'3.0.142\' WHERE conf_name=\'o_cur_version\'',
		),
		// post moderation
		array(
			'ALTER TABLE `#__agora_forums` ADD `use_moderation` tinyint(1) NOT NULL DEFAULT \'0\'',
			'ALTER TABLE `#__agora_topics` ADD `approved` tinyint(1) NOT NULL DEFAULT \'1\'',
			'ALTER TABLE `#__agora_posts` ADD `approved` tinyint(1) NOT NULL DEFAULT \'1\'',
			'ALTER TABLE `#__agora_permissions` ADD `post_approve` tinyint(1) NOT NULL DEFAULT \'0\'',
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_subscrb_auto_unapproved\', \'0\')',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'3.0.143\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'INSERT INTO `#__agora_config` (conf_name, conf_value) VALUES (\'o_email_sender\', \'\')',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'3.0.145\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_moderated_subject\', \'New post held for moderation\')',
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_moderated_messg\', \'<p>Hello [username]<br /> <br />There is a new moderated post in forum [forum] on [sitename]. Poster: [poster]<br />Subject: [title]<br /> Post: <br />[message]<br /> <br />Please go to [moderation] to approve or disapprove it.<br /><br /></p>
<p>Thank You<br />Site Administration</p>\')',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'3.0.146\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'3.0.147\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'o_attachment_path\', \'\')'
		),
		array(
			'INSERT INTO #__agora_config (conf_name, conf_value) VALUES (\'router_slugs\', \'0\')'
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'3.0.148\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'3.0.149\' WHERE conf_name=\'o_cur_version\'',
		),
		array(
			'UPDATE `#__agora_config` SET conf_value = \'3.0.150\' WHERE conf_name=\'o_cur_version\'',
		),
	);

	function setDefaultPermissions(&$db) {
		$db->setQuery('SELECT * FROM #__agora_group');
		$groups = $db->loadAssocList();

		$db->setQuery('SELECT * FROM #__agora_roles');
		$roles = $db->loadAssocList();

		$default = array(
			'guest' => array (
				'read'			=> 1,
				'read_rss'		=> 1,
				'bbcode'		=> 0,
				'bbcode_img'	=> 0,
				'post_reply'	=> 0,
				'post_poll'		=> 0,
				'post_topic'	=> 0,
				'edit_topic'	=> 0,
				'edit_posts'	=> 0,
				'delete_topics'	=> 0,
				'delete_posts'	=> 0,
				'make_sticky'	=> 0,
				'close_topic'	=> 0,
				'post_approve'	=> 0,
				'use_captcha'	=> 0,
			),
			'member' => array (
				'read'			=> 1,
				'read_rss'		=> 1,
				'bbcode'		=> 1,
				'bbcode_img'	=> 1,
				'post_reply'	=> 1,
				'post_poll'		=> 1,
				'post_topic'	=> 1,
				'edit_topic'	=> 1,
				'edit_posts'	=> 1,
				'delete_topics'	=> 0,
				'delete_posts'	=> 0,
				'make_sticky'	=> 0,
				'close_topic'	=> 0,
				'post_approve'	=> 0,
				'use_captcha'	=> 0,
			),
			'moderator' => array (
				'read'			=> 1,
				'read_rss'		=> 1,
				'bbcode'		=> 1,
				'bbcode_img'	=> 1,
				'post_reply'	=> 1,
				'post_poll'		=> 1,
				'post_topic'	=> 1,
				'edit_topic'	=> 1,
				'edit_posts'	=> 1,
				'delete_topics'	=> 1,
				'delete_posts'	=> 1,
				'make_sticky'	=> 1,
				'close_topic'	=> 1,
				'post_approve'	=> 1,
				'use_captcha'	=> 0,
			),
			'admin' => array (
				'read'			=> 1,
				'read_rss'		=> 1,
				'bbcode'		=> 1,
				'bbcode_img'	=> 1,
				'post_reply'	=> 1,
				'post_poll'		=> 1,
				'post_topic'	=> 1,
				'edit_topic'	=> 1,
				'edit_posts'	=> 1,
				'delete_topics'	=> 1,
				'delete_posts'	=> 1,
				'make_sticky'	=> 1,
				'close_topic'	=> 1,
				'post_approve'	=> 1,
				'use_captcha'	=> 0,
			),
		);
		foreach ($groups as $group) {
			$group_id = intval($group['id']);
			foreach ($roles as $role) {
				$role_id = intval($role['id']);
				$db->setQuery('SELECT access_id'.
							' FROM #__agora_group_permissions'.
							' WHERE group_id = '.$group_id.
							'   AND role_id = '.$role_id.
							' LIMIT 1'
							);
				$access_id = $db->loadResult();
				if (!is_null($access_id)) continue;
				$role_name = strtolower(trim($role['name']));

				if (!isset($default[$role_name])) continue;
				$sql = 'INSERT INTO #__agora_permissions SET ';

				$fields = array();
				foreach ($default[$role_name] as $name=>$value) {
					$fields[] = $db->nameQuote($name).'='.$db->Quote($value);
				}
				$sql .= implode(', ',$fields);
				$db->setQuery($sql);
				if (!$db->query()) {
					continue;
				}
				
				$access_id = $db->insertid();

				$sql = 'INSERT INTO #__agora_group_permissions SET '.
								'group_id = '.$group_id.','.
								'role_id = '.$role_id.','.
								'access_id = '.$access_id;
				$db->setQuery($sql);
				$db->query();
			}
		}
	}
	
	function updateModerationRights(&$db) {
		// check if any of the admin and mods can moderate
		$sql = 'SELECT SUM(p.post_approve) as approve
				FROM #__agora_group_permissions gp
					JOIN #__agora_permissions p ON gp.access_id = p.id
				WHERE gp.role_id IN (3, 4)';
		$db->setQuery($sql);
		$sum_approve = (int)$db->loadResult();
		
		// if none of them can moderate, then grant this permission to all of them
		if (!$sum_approve) {
			$sql = 'UPDATE #__agora_group_permissions gp
						JOIN #__agora_permissions p ON gp.access_id = p.id
					SET p.post_approve = 1
					WHERE gp.role_id IN ( 3, 4 )';
			$db->setQuery($sql);
			@$db->query();
		}
	}

	function getStatements($current_revision) {
		$stmts = array();
		$last = 1;
		foreach ($this->statements as $rev=>$st_list) {
			$last = $rev;
			if ($rev <= $current_revision) continue;

			foreach ($st_list as $st)
				$stmts[] = $st;

		}

		if ($current_revision != $last) {
			$stmts[] = 'UPDATE `#__agora_config` SET conf_value = '.$last.' WHERE conf_name = \'o_database_revision\'';

			// if something changed in database - version may be updated too
			$stmts[] = 'UPDATE `#__agora_config` SET conf_value = "'.AGORA_VERSION.'" WHERE conf_name = \'o_cur_version\'';
		}
		
		return $stmts;
	}

	function upgrade() {
		$db = & JFactory::getDBO();
		$old_debug = $db->_debug;
		$db->debug(0);
		$db->setQuery('SELECT conf_value FROM #__agora_config WHERE conf_name = \'o_database_revision\'');
		$current_revision = $db->loadResult();
		$sts = $this->getStatements($current_revision);

		foreach ($sts as $st) {
			if (method_exists($this, $st)) {
				$this->$st($db);
				continue;
			}

			@$db->setQuery($st);
			@$db->query();
		}
		
		$this->updateModerationRights($db);
		
		$db->debug($old_debug);
	}
};
